<script>
  import config from './config'
  import permission from './permission'
  import store from '@/store'
  import { getToken } from '@/utils/auth'
  export default {
    onLaunch: function() {
      this.initApp()
	  // uni.onTabBarMidButtonTap(() => {
	  //     uni.navigateTo({
	  //         url: '/pages/mine/info',
	  //         animationType: 'slide-in-bottom',
	  //         animationDuration: 150
	  //     });
	  // });
    },
	
    methods: {
      // 初始化应用
      initApp() {
        // 初始化应用配置
        this.initConfig()
        // 检查用户登录状态
        //#ifdef H5
        this.checkLogin()
        //#endif
      },
      initConfig() {
        this.globalData.config = config
      },
      checkLogin() {
        // 白名单
        if (permission.whiteList.indexOf("/"+uni.getLaunchOptionsSync().path) !== -1){
        } else {
          if (!getToken()) {
            this.$tab.reLaunch('/pages/login')
          }
        }
      }
    }
  }
</script>

<style lang="scss">
	.uni-picker-container .uni-picker-action.uni-picker-action-confirm{
		color: #00a660 !important;
	}
	.uni-modal .uni-modal__btn_primary{
		color:#00a660 !important;
	}
	// iphone底部适配 安全距离
	.safe-area-inset-bottom{
		padding-bottom: 10rpx;
		padding-bottom: calc(10rpx + constant(safe-area-inset-bottom));
		padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
	}
	.uni-input-input{
		color: #666;
	}
	uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
	    border-color: #00a660 !important;
	}
	uni-picker .uni-picker-container .uni-picker-action .uni-picker-action-confirm{
		color: #00a660 !important;
	}
  @import '@/static/scss/index.scss';
  @import'@/static/iconfont/iconfont.css';
  @import'@/static/sealFont/font.css';
</style>
